public class Test {
    public static void main(String[] args) {
        int num = 10;
        boolean flag = !(num==10);
        System.out.println(flag);
    }

    public static void main20(String[] args) {
//        System.out.println(10 > 20 && 10/0 == 0);
//        System.out.println(10 < 20 || 10/0 == 0);

//        System.out.println(10 > 20 & 10/0 == 0);
//        System.out.println(10 < 20 | 10/0 == 0);
    }

    public static void main18(String[] args) {
        int a = 1;
        int b = 2;
        System.out.println(a == 1 || b == 2); // 两边为假,则为假
        System.out.println(a == 1 || b > 100); // 有真,则为真
        System.out.println(a > 100 || b == 2);
        System.out.println(a > 100 || b > 100);
    }
    public static void main17(String[] args) {
        int a = 1;
        int b = 2;
        System.out.println(a == 1 && b == 2); // 两边为真,则为真
        System.out.println(a == 1 && b > 100); // 有假,则为假
        System.out.println(a > 100 && b == 2);
        System.out.println(a > 100 && b > 100);
    }
    public static void main16(String[] args) {
        int a = 10;
        int b = 20;
        System.out.println(a == b);
        System.out.println(a >= b);
        System.out.println(a <= b);
        System.out.println(a > b);
        System.out.println(a < b);
        System.out.println(a != b);
    }
    public static void main15(String[] args) {
        int a = 10;
        // int b = ++a;
        int b = a++;
        System.out.println(a);
        System.out.println(b);
    }
    public static void main14(String[] args) {
//        int a = 2;
//        a += 1;
//        System.out.println(a);

        int b = 10;
        // b += 2.5;
        // b = b + 2.5; // err
        b = (int)(b + 2.5);
        System.out.println(b);
    }

    public static void main13(String[] args) {
        int a = 10;
        // int b = 0;
        // int c = a/b; //err
        int d = 8;
        System.out.println(a/d);

        // 除数的符号是什么,余数的符号就是什么
        System.out.println(10%3);  // 1
        System.out.println(10%-3); // 1
        System.out.println(-10%3); //-1
        System.out.println(-10%-3);//-1

        System.out.println(11.5%3);//2.5
    }

    public static void main12(String[] args) {
        String str1 = "10";
        int num1 = Integer.parseInt(str1);
        System.out.println(num1);

        String str2 = "3.14";
        double num2 = Double.parseDouble(str2);
        System.out.println(num2);
    }

    public static void main11(String[] args) {
        int num = 10;

        // 方法1
        String str1= num + "";
        System.out.println(str1);

        // 方法2
        String str2 = String.valueOf(num);
        System.out.println(str2);

        String str3 = String.valueOf(123455);
        System.out.println(str3);

        String str4 = String.valueOf(3.15);
        System.out.println(str4);
    }

    public static void main10(String[] args) {
        System.out.println("自动换行......");
        System.out.print("不自动换行......");
        System.out.printf("%s\n", "helloworld");
    }
    public static void main9(String[] args) {
        int a = 10;
        int b = 20;
        // System.out.println("a = " + a + ", " + "b = " + b);
        System.out.println("a + b = " + (a+b));
        System.out.println(a+b+"hahaha");
    }
    public static void main8(String[] args) {
        String str1 = "hello";
        String str2 = "world";

        System.out.println("str1: "+ str1);
        System.out.println("str2: " + str2);

        String str3 = str1+ " " +str2;
        System.out.println(str3);
    }

    public static void main7(String[] args) {
//        int a = 100;
//        long b = 1000L;
//        b = a;
//        // a = b; //err 这里需要强制类型转换
//        a = (int)b; // 不过会造成数据丢失

//        int a = 257;
//        byte b = 100;
//        b = (byte)a;
//
//        boolean flag = true;
//        // int flag2 = (int)flag;

        int a = 10;
        long b = 20L;
//        // long c = a + b;
//        int c = a+b; // err
//        int c = (int)(a+b);
//        System.out.println(c);

        byte a1 = 10;
        byte a2 = 20;
        // 所有小于四个字节的数据,在运算的时候会被提升为4个字节
        // byte a3 = a1+a2; // err
        byte a3 = (byte)(a1+a2);
        System.out.println(a3);
    }
    public static void main6(String[] args) {
        boolean flag = true;
        System.out.println(flag);
    }

    public static void main5(String[] args) {
        char ch1 = 'a';
        char ch2 = 97;
        System.out.println(ch1);
        System.out.println(ch2);

        char sex = '男';
        System.out.println(sex);

        System.out.println(Character.MAX_VALUE);
        System.out.println(Character.MIN_VALUE);
    }

    public static void main3(String[] args) {
//        int a = 100;
//        double b = 3.14;
//        char ch = 'a';
//        boolean flag = true;
//        System.out.println(a);
//        System.out.println(b);
//        System.out.println(ch);
//        System.out.println(flag);
//
//        System.out.println("==================");
//
//        a =100;
//        System.out.println(a);
//
//        int a1 = 30, a2 = 40, a3 = 50;
//        System.out.println(a1);
//        System.out.println(a2);
//        System.out.println(a3);
//        double d = 3.14;
//        float f = 3.14F;
//        System.out.println(d);
//        System.out.println(f);
//        int a = 1;
//        int b = 2;
//        System.out.println(a/b);
//
//        double a1 = 1.0;
//        double b2 = 2.0;
//        System.out.println(a1/b2);
        // 小数是不能精确到每一位,只能精确到小数点后几位
        double num = 1.1;
        System.out.println(num*num);
    }

    public static void main2(String[] args) {
        System.out.println("intMax:" +Integer.MAX_VALUE);
        System.out.println("intMax:" +Integer.MIN_VALUE);
        System.out.println("===================");
        System.out.println("byteMax:" + Byte.MAX_VALUE);
        System.out.println("byteMin:" + Byte.MIN_VALUE);
        System.out.println("===================");
        System.out.println("charMax:" + Character.MAX_VALUE);
        System.out.println("charMin:" + Character.MIN_VALUE);
        System.out.println("===================");
        System.out.println("doubleMax:" + Double.MAX_VALUE);
        System.out.println("doubleMin:" + Double.MIN_VALUE);
        System.out.println("===================");
        System.out.println("longMax:" + Long.MAX_VALUE);
        System.out.println("longMin:" + Long.MIN_VALUE );
        System.out.println("===================");
        System.out.println("floatMax:" + Float.MAX_VALUE);
        System.out.println("floatMin" + Float.MIN_VALUE);
        System.out.println("===================");
        System.out.println("shortMax:" + Short.MAX_VALUE);
        System.out.println("shortMin" + Short.MIN_VALUE);

    }

    public static void main1(String[] args) {
        System.out.println(1000);
        System.out.println(3.14);
        System.out.println("hello world");
        System.out.println('a');
        System.out.println(true);
        System.out.println(false);
    }
}
